import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopUserAddressController } from '../../../controllers';
const uctoominishopUserAddressRouter = new Router();
const minishopUserAddressController = new uctooMinishopUserAddressController();

uctoominishopUserAddressRouter.post('/add', requireUser, minishopUserAddressController.add);
uctoominishopUserAddressRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_user_address'), minishopUserAddressController.edit);
uctoominishopUserAddressRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_user_address'), minishopUserAddressController.delete);

//For getting minishopUserAddress with permission control
uctoominishopUserAddressRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_user_address'), minishopUserAddressController.getSingle);
uctoominishopUserAddressRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_user_address'), minishopUserAddressController.getMany);
uctoominishopUserAddressRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_user_address'), minishopUserAddressController.getMany);

//#endregion AutoCreateCode
export default uctoominishopUserAddressRouter;
